package cz.muni.fi.pa165.rentalofconstructionmachinery.dao;

import cz.muni.fi.pa165.rentalofconstructionmachinery.entity.Machine;
import java.util.List;

/**
 *
 * @author Zuzana Krejcova
 */
public interface MachineDAO {
    
    /**
     * Creates a record of the entity machine in database.
     * @param machine Machine to be persisted
     * @return
     * @throws IllegalArgumentException if either the parameter machine or it's license plate are null
     */
    public void createMachine(Machine machine) throws IllegalArgumentException;
    
    /**
     * Deletes the entity machine from the database.
     * @param machine Machine to be deleted
     * @throws IllegalArgumentException if the parameter machine is null
     */
    public void deleteMachine(Machine machine) throws IllegalArgumentException;
    
    /**
     * Updates the record of the entity machine in database.
     * @param machine Machine to be updated
     * @throws IllegalArgumentException if the parameter machine is null
     */
    public void updateMachine(Machine machine) throws IllegalArgumentException;
    
    /**
     * 
     * @return the list of all Machines in the database
     */
    public List<Machine> getAllMachines();
    
    /**
     * Get the persisted Machine with the specified ID.
     * @param id ID to search by
     * @return the Machine with ID id
     * @throws IllegalArgumentException if the parameter id is null
     */
    public Machine getMachineById(Long id) throws IllegalArgumentException;
}
